#!/bin/bash

# myshell tools
# commit the changed in current branch to locale and push it to remote"
# usage:
#   git-commit.sh $1
#        $1: commit message
# remark:
#  if report error with not found "read-passwd" function or command,
#  pelase exec install.sh first.


function fatal()
{
    echo "!! $*"
    exit 1
}

if [[ $# -lt 1 ]]; then
    echo "Usage: $0 \$1 "
    echo "  \$1: commit message"
    exit 1
fi

echo "-----------------------------"
echo "* commit changed in this branch *"
echo "-----------------------------"
echo "* let's GOGOGO... *"
git status
echo "-----------------------------"
git branch
echo "-----------------------------"
echo "* add all changed and commit *"
git add -A
git commit -m"$1"

echo "-----------------------------"
echo "* shell exec over,see you next time... *"
echo "-----------------------------"
git status
